<template>
  <div class="root">
		<button class="btn btn-xs btn-success" @click.stop="update" title="更新">
			<i class="ace-icon fa fa-check bigger-120"></i>
		</button>

		<button class="btn btn-xs btn-danger" title="删除">
			<i class="ace-icon fa fa-trash-o bigger-120"></i>
		</button>
  </div>
</template>

<script>
export default {
  /* table组件的自定义列子组件 */
  name: 'tableOperation',
  props: {
    rowData: Object,
    field: String,
    index: Number
  },
  methods: {
    update () {
      let param = {type: 'edit', rowData: this.rowData, field: this.field, index: this.index}
      this.$emit('on-custom-comp', param)
    },
    remove () {
      let param = {type: 'delete', rowData: this.rowData, field: this.field, index: this.index}
      this.$emit('on-custom-comp', param)
    }
  }
}
</script>
<style scoped>
	button{
		margin-left: .5rem;
		margin-right: .5rem;
	}
</style>